import React from 'react';
import { authSite } from '../../../config/defaultSettings';

import styles from '@/layouts/userInfoLayout.less';

const LayoutLoading = () => (
  <div className={styles.contentLoading}>
    <div className="page-loading-warp">
      <div className="ant-spin ant-spin-lg ant-spin-spinning">
        <span className="ant-spin-dot ant-spin-dot-spin">
          <i className="ant-spin-dot-item"></i>
          <i className="ant-spin-dot-item"></i>
          <i className="ant-spin-dot-item"></i>
          <i className="ant-spin-dot-item"></i>
        </span>
      </div>
    </div>
  </div>
);
const AuthLogin = props => {
  const { location } = props;
  const loginUrl = authSite && authSite.loginUrl ? authSite.loginUrl : '/#/user/login';
  const redirectUrl = loginUrl + location.search;
  console.log('%c redirect:', 'color:green', redirectUrl);
  window.location.href = redirectUrl;
  return <LayoutLoading />;
};

export default AuthLogin;
